package com.game.util;

import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;

public class HttpUtils {
	
	
	//访问微信高级接口的方法
	//get方法
	public static String getHttp(String url){
		Client client = ClientBuilder.newClient();
		String string = client.target(url).request().get(String.class);
		client.close();
		return string;
	}
	//POST方法
	public static String postHttp(String url,String postBody){
		Client client = ClientBuilder.newClient();
		String string = client.target(url).request().post(Entity.text(postBody), String.class);
		client.close();
		return string;
	}
}
